package com.heima.wemedia.controller.v1;

import com.heima.model.comment.dtos.WmCommentManageFindDto;
import com.heima.model.comment.dtos.WmCommentManageLikeDto;
import com.heima.model.comment.dtos.WmCommentManageListDto;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.wemedia.service.WmCommentManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 加油, believe oneself
 * @data 2023/6/29 15:48
 */

@RestController
@RequestMapping("/api/v1/comment/manage")
public class WmCommentManageController {

    @Autowired
    private WmCommentManageService wmCommentManageService;



    /**
     *  展示文章评论详情
     * @param dto
     * @return
     */
    @PostMapping("/list")
    public ResponseResult listComment(@RequestBody WmCommentManageListDto dto){
        return wmCommentManageService.listComments(dto);
    }

    /**
     * 点赞
     * @param dto
     * @return
     */
    @PostMapping("/like")
    public ResponseResult likeComment(@RequestBody WmCommentManageLikeDto dto){
        return wmCommentManageService.likeComments(dto);
    }

}
